/* This code was modified by Georges Hanna Fab Academy 2018,INTERFACE AND APPLICATION PROGRAMING The code was modified Based on the below codes : https://forum.arduino.cc/index.php?topic=386417.0 https://create.arduino.cc/projecthub/mayooghgirish/arduino-bluetooth-basic-tutorial-d8b737 */ #include #define TxD 0 #define RxD 1 SoftwareSerial blueToothSerial(RxD,TxD); int led =7; // The led light is connected to Attiny pin # 7 void setup() { blueToothSerial.begin(9600); pinMode(RxD, INPUT); // Define RxD pin as an input pinMode(TxD, OUTPUT); // Define TxD pin as an output pinMode(led,OUTPUT); // Define led pin as an output } void loop() { digitalWrite(led,HIGH); // Turn the led on delay (1000); // Delay for 1 second blueToothSerial.println('1'); digitalWrite(led,LOW); // Turn the led off delay (1000); // Delay for 1 second blueToothSerial.println('0'); blueToothSerial.flush(); // Using flush to clear Bluetooth Buffer }